package com.xywy.bloodandroid.act;

import java.util.HashSet;
import java.util.Iterator;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.xywy.bloodandroid.R;
import com.xywy.bloodandroid.base.BaseActivity;
import com.xywy.bloodandroid.util.UIUtil;

public class ChanceDiseaseAct extends BaseActivity {

	private EditText edit_tv;
	private TextView cancle;
	private TextView confire;
	private SharedPreferences sp;

	@Override
	protected void initView(Bundle savedInstanceState) {
		setContentView(R.layout.pop_edtext);
		
		TextView title = (TextView) findViewById(R.id.title);

		edit_tv = (EditText)findViewById(R.id.edit_tv);

		cancle = (TextView)findViewById(R.id.cancle);
		confire = (TextView)findViewById(R.id.confire);
		
		

	}

	@Override
	protected void initListener() {
		cancle.setOnClickListener(this);
		confire.setOnClickListener(this);

	}

	@Override
	protected void initData() {
		
		

	}
	
	private void  Finish(){
		Intent date = new Intent();
		date.putExtra("disease", edit_tv.getText().toString().trim());
		setResult(1, date);
		finish();
	};
	@Override
	public void onClick(View v) {
		super.onClick(v);
		switch (v.getId()) {
		case R.id.confire:
			if(edit_tv.getText().toString().trim().length()>0)
			Finish();
			else
				UIUtil.showToast(context, "内容不能为空 ");
			break;
		case R.id.cancle:
			Finish();
			break;

		default:
			break;
		}
	}

}
